#include "mainwindow.h"
#include"dlg_login.h"
#include <QApplication>
#include "lib/sqlmgr.h"
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Sqlmgr::getinstance()->init();
    MainWindow w;
    Dlg_login dlg;
    // 建立信号和槽的连接
    QObject::connect(&dlg, &Dlg_login::sendLoginname, &w, &MainWindow::onLoginSuccesssful);
    int ret=dlg.exec();//阻塞程序直到登录对话框关闭，才能进行下一条语句
    if(1==ret)
    {
        w.show();
        return a.exec();
    }
    if(0==ret)
    {
        exit(0);
        return 0;
    }
    return 0;
}
